<?php
/*
 * Copyright (C) 2014 University of Pittsburgh
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

require_once('util/JurisdictionSelect.inc');
require_once('util/HTMLSelect.inc');
require_once('util/Constants.inc');
require_once('util/StaticFunctions.inc');

$user_agent = $_SERVER['HTTP_USER_AGENT'];

StaticFunctions::load_reference_data();

$jurisdiction_select = new JurisdictionSelect();
$jurisdiction_select->id = 'slct_jurisdiction';
$jurisdiction_select->name = 'slct_jurisdiction';
$jurisdiction_select->is_multiple = true;
$jurisdiction_select->is_dijit = true;

/*
 * The Acting Agent Selects
*/
$acting_agent_select = new HTMLSelect();
$acting_agent_select->id = 'slct_acting_agent';
$acting_agent_select->name = 'slct_acting_agent';
$acting_agent_select->style = 'width: 15em;';
$acting_agent_select->is_multiple = true;
$acting_agent_select->is_dijit = true;
$tmp_array = StaticFunctions::get_reference_data(Constants::REF_TABLE_CODE_AGENT);
$tmp_array = array(-1 => '--- ALL ---') + $tmp_array;
$acting_agent_select->key_val_map = $tmp_array;

$aa_subset_select = new HTMLSelect();
$aa_subset_select->id = 'slct_aa_subset';
$aa_subset_select->name = 'slct_aa_subset';
$aa_subset_select->style = 'width: 20em;';
$aa_subset_select->is_multiple = true;
$aa_subset_select->is_dijit = true;
$tmp_array = StaticFunctions::get_reference_data(Constants::REF_TABLE_CODE_SUBSET);
$tmp_array = array(-1 => '--- ALL ---') + $tmp_array;
$aa_subset_select->key_val_map = $tmp_array;

$aa_footnote_select = new HTMLSelect();
$aa_footnote_select->id = 'slct_aa_footnote';
$aa_footnote_select->name = 'slct_aa_footnote';
$aa_footnote_select->style = 'width: 15em;';
$aa_footnote_select->is_multiple = true;
$aa_footnote_select->is_dijit = true;
$tmp_array = StaticFunctions::get_reference_data(Constants::REF_TABLE_CODE_FOOTNOTE);
$tmp_array = array(-1 => '--- ALL ---') + $tmp_array;
$aa_footnote_select->key_val_map = $tmp_array;


/*
 * The Paticipating Agent Selects
 */
$participating_agent_select = new HTMLSelect();
$participating_agent_select->id = 'slct_participating_agent';
$participating_agent_select->name = 'slct_participating_agent';
$participating_agent_select->style = 'width: 15em;';
$participating_agent_select->is_multiple = true;
$participating_agent_select->is_dijit = true;
$tmp_array = StaticFunctions::get_reference_data(Constants::REF_TABLE_CODE_AGENT);
$tmp_array = array(-1 => '--- ALL ---') + $tmp_array;
$participating_agent_select->key_val_map = $tmp_array;

$pa_subset_select = new HTMLSelect();
$pa_subset_select->id = 'slct_pa_subset';
$pa_subset_select->name = 'slct_pa_subset';
$pa_subset_select->style = 'width: 20em;';
$pa_subset_select->is_multiple = true;
$pa_subset_select->is_dijit = true;
$tmp_array = StaticFunctions::get_reference_data(Constants::REF_TABLE_CODE_SUBSET);
$tmp_array = array(-1 => '--- ALL ---') + $tmp_array;
$pa_subset_select->key_val_map = $tmp_array;

$pa_footnote_select = new HTMLSelect();
$pa_footnote_select->id = 'slct_pa_footnote';
$pa_footnote_select->name = 'slct_pa_footnote';
$pa_footnote_select->style = 'width: 15em;';
$pa_footnote_select->is_multiple = true;
$pa_footnote_select->is_dijit = true;
$tmp_array = StaticFunctions::get_reference_data(Constants::REF_TABLE_CODE_FOOTNOTE);
$tmp_array = array(-1 => '--- ALL ---') + $tmp_array;
$pa_footnote_select->key_val_map = $tmp_array;

/*
 * The Aditional Parameter Selects 
 */
$action_select = new HTMLSelect();
$action_select->id = 'slct_action';
$action_select->name = 'slct_action';
$action_select->style = 'width: 35em;';
$action_select->is_multiple = true;
$action_select->is_dijit = true;
$tmp_array = StaticFunctions::get_reference_data(Constants::REF_TABLE_CODE_ACTION);
$tmp_array = array(-1 => '--- ALL ---') + $tmp_array;
$action_select->key_val_map = $tmp_array;

$condition_select = new HTMLSelect();
$condition_select->id = 'slct_condition';
$condition_select->name = 'slct_condition';
$condition_select->style = 'width: 75em;';
$condition_select->is_multiple = true;
$condition_select->is_dijit = true;
$tmp_array = StaticFunctions::get_reference_data(Constants::REF_TABLE_CODE_CONDITION);
$tmp_array = array(-1 => '--- ALL ---') + $tmp_array;
$condition_select->key_val_map = $tmp_array;

$emergency_select = new HTMLSelect();
$emergency_select->id = 'slct_emergency';
$emergency_select->name = 'slct_emergency';
$emergency_select->style = 'width: 35em;';
$emergency_select->is_multiple = true;
$emergency_select->is_dijit = true;
$tmp_array = StaticFunctions::get_reference_data(Constants::REF_TABLE_CODE_EMERGENCY);
$tmp_array = array(-1 => '--- ALL ---') + $tmp_array;
$emergency_select->key_val_map = $tmp_array;

$goal_select = new HTMLSelect();
$goal_select->id = 'slct_goal';
$goal_select->name = 'slct_goal';
$goal_select->style = 'width: 35em;';
$goal_select->is_multiple = true;
$goal_select->is_dijit = true;
$tmp_array = StaticFunctions::get_reference_data(Constants::REF_TABLE_CODE_GOAL);
$tmp_array = array(-1 => '--- ALL ---') + $tmp_array;
$goal_select->key_val_map = $tmp_array;

$prescription_select = new HTMLSelect();
$prescription_select->id = 'slct_prescription';
$prescription_select->name = 'slct_prescription';
$prescription_select->style = 'width: 35em;';
$prescription_select->is_multiple = true;
$prescription_select->is_dijit = true;
$tmp_array = StaticFunctions::get_reference_data(Constants::REF_TABLE_CODE_PRESCRIPTION);
$tmp_array = array(-1 => '--- ALL ---') + $tmp_array;
$prescription_select->key_val_map = $tmp_array;

$purpose_select = new HTMLSelect();
$purpose_select->id = 'slct_purpose';
$purpose_select->name = 'slct_purpose';
$purpose_select->style = 'width: 35em;';
$purpose_select->is_multiple = true;
$purpose_select->is_dijit = true;
$tmp_array = StaticFunctions::get_reference_data(Constants::REF_TABLE_CODE_PURPOSE);
$tmp_array = array(-1 => '--- ALL ---') + $tmp_array;
$purpose_select->key_val_map = $tmp_array;

$timeframe_select = new HTMLSelect();
$timeframe_select->id = 'slct_timeframe';
$timeframe_select->name = 'slct_timeframe';
$timeframe_select->style = 'width: 35em;';
$timeframe_select->is_multiple = true;
$timeframe_select->is_dijit = true;
$tmp_array = StaticFunctions::get_reference_data(Constants::REF_TABLE_CODE_TIMEFRAME);
$tmp_array = array(-1 => '--- ALL ---') + $tmp_array;
$timeframe_select->key_val_map = $tmp_array;

// Upload Page Selects
$jurisdiction_select_upload = new JurisdictionSelect();
$jurisdiction_select_upload->id = 'slct_jurisdiction_upload';
$jurisdiction_select_upload->name = 'slct_jurisdiction_upload';
$jurisdiction_select_upload->is_multiple = true;
$jurisdiction_select_upload->is_dijit = true;

$node_select_upload = new HTMLSelect();
$node_select_upload->id = 'slct_nodes_upload';
$node_select_upload->name = 'slct_nodes_upload';
$node_select_upload->style = 'width: 30em;';
$node_select_upload->is_multiple = true;
$node_select_upload->is_dijit = true;
$node_select_upload->key_val_map = StaticFunctions::get_reference_data(Constants::REF_TABLE_CODE_AGENT);

$doc_frmt_select_upload = new HTMLSelect();
$doc_frmt_select_upload->id = 'slct_doc_frmt';
$doc_frmt_select_upload->name = 'slct_doc_frmt';
$doc_frmt_select_upload->style = 'width: 5em;';
$doc_frmt_select_upload->is_multiple = false;
$doc_frmt_select_upload->is_dijit = true;
$doc_frmt_select_upload->key_val_map = array(
    ' ' => '----',
    'DOC' => 'DOC',
    'DOCX' => 'DOCX',
    'PDF' => 'PDF');

$is_admin = true;

?>

<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
 
<html>
<head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="description" content="" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Public Health Adaptive System Studies: Administration</title>
    <link rel="stylesheet" href="css/normalize.css" />
    <link rel="stylesheet" href="css/style.css" media="screen">
    <link rel="stylesheet" href="<?php echo Constants::WHERE_IS_DOJO . '/dijit/themes/claro/claro.css'; ?>" media="screen">
    <style>
			#grid .field-date, #grid .field-date2 {
				width: 16em;
			}
			#grid .field-integer {
				width: 6em;
			}
			#grid .field-bool {
				width: 6em;
			}
			.dgrid {
				margin: 10px;
			}
    </style>    
</head>

<body class="claro">
    <!--[if lt IE 7]>
            <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
        <![endif]-->
	<!-- basic preloader: -->
    <div id="app_layout" class="app_ayout" data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design: 'headline'">
        <div id="center_panel_tab_container" data-dojo-type="dijit/layout/TabContainer" 
             data-dojo-props="region: 'center', tabPosition: 'bottom'">
            <!-- Begin Seach Tab -->
            <div  id="tab_search" data-dojo-type="dijit/layout/ContentPane" title="Search">
                <h2 style="text-align: center;">Legal and Ethical Indicators of Adaptive Public Health System Response</h2>
                <br />
                <form id="frm_search" name="frm_search" method="POST" action="get_search_results.php"
                      data-dojo-type="dijit/form/Form" class="frm_table" enctype="multipart/form-data">  
                    <input id="valid_request_key" name="valid_request_key" type="hidden" value="<?php echo Constants::VALID_REQUEST_KEY; ?>" />      
                <table id="table_frm_search">
                <tr>
                    <td style="text-align: right; width: 40%;" colspan="3">
                        Enter the Keyword(s):<br />
                        <span style="font-size: smaller;">(comma separated)</span>
                        <br />
                        <input id="txt_keyword" type="text" name="txt_keyword"
                               data-dojo-type="dijit/form/TextBox"
                               style="width: 20em;" />   
                    </td>
                    <td style="text-align: left; width: 26%;">
                        <input type="radio" data-dojo-type="dijit/form/RadioButton" name="keyword_search_type" 
                               id="rd_key_or" value="OR" checked="checked"/>
                        <label for="rd_key_or">OR</label> &nbsp;
                        <input type="radio" data-dojo-type="dijit/form/RadioButton" name="keyword_search_type" 
                               id="rd_key_and" value="AND"/> 
                        <label for="rd_key_and">AND</label>      
                    </td>   
                    <td style="text-align: right; width: 7%;">Jurisdictions:</td> 
                    <td style="text-align: left; width: 27%;">
                        <div id="jurisdictions">
                            <?php
                              echo $jurisdiction_select->get_html(8);
                            ?>
                            <br />
                            <?php if(StaticFunctions::detect_os($user_agent) == Constants::MAC_OS) { ?>
                            <span class="multi_select_inst">Use Command-key to select multiple items</span>
                            <?php } else { ?>
                            <span class="multi_select_inst">Use Ctrl-key to select multiple items</span>
                            <?php } ?>             
                        </div>
                    </td> 
                </tr>

                <!-- Begin Acting / Participating Agent Tables -->
                <tr class="search_params_top">                   
                    <td style="text-align: center;" colspan="6">Acting Agents</td>
                </tr>
                <tr class="search_params_bottom">
                    <td style="text-align: right; width: 7%;">
                        Nodes:
                        <br />
                        <a href="http://www.phasys.pitt.edu/pdf/Node_Definitions.pdf" id="node_def_link" target="_blank">Node Definitions</a>
                    </td>
                    <td style="text-align: left; width: 26%;">
                        <div id="acting_agents">
                            <?php
                              echo $acting_agent_select->get_html(7);
                            ?>
                            <br />
                            <?php if(StaticFunctions::detect_os($user_agent) == Constants::MAC_OS) { ?>
                            <span class="multi_select_inst">Use Command-key to select multiple items</span>
                            <?php } else { ?>
                            <span class="multi_select_inst">Use Ctrl-key to select multiple items</span>
                            <?php } ?>
                        </div>     
                    </td>
                    <td style="text-align: right; width: 7%;">Subsets:</td>
                    <td style="text-align: left; width: 26%;">
                        <div id="aa_subset">
                            <?php
                              echo $aa_subset_select->get_html(7);
                            ?>
                            <br />
                            <?php if(StaticFunctions::detect_os($user_agent) == Constants::MAC_OS) { ?>
                            <span class="multi_select_inst">Use Command-key to select multiple items</span>
                            <?php } else { ?>
                            <span class="multi_select_inst">Use Ctrl-key to select multiple items</span>
                            <?php } ?>             
                        </div>
                    
                    </td>
                    <td style="text-align: right; width: 7%;">Footnotes:</td>
                    <td style="text-align: left; width: 27%;">
                        <div id="aa_footnotes">
                            <?php
                              echo $aa_footnote_select->get_html(7);
                            ?>
                            <br />
                            <?php if(StaticFunctions::detect_os($user_agent) == Constants::MAC_OS) { ?>
                            <span class="multi_select_inst">Use Command-key to select multiple items</span>
                            <?php } else { ?>
                            <span class="multi_select_inst">Use Ctrl-key to select multiple items</span>
                            <?php } ?>             
                        </div>
                    </td>
                </tr>
                <tr class="search_params_top">
                    <td style="text-align: center;" colspan="6">Participating Agents</td>
                </tr>
                <tr class="search_params_bottom">
                    <td style="text-align: right; width: 7%;">
                        Nodes:
                        <br />
                        <a href="http://www.phasys.pitt.edu/pdf/Node_Definitions.pdf" id="node_def_link" target="_blank">Node Definitions</a>
                    </td>
                    <td style="text-align: left; width: 26%;">
                        <div id="participating_agents">
                            <?php
                              echo $participating_agent_select->get_html(7);
                            ?>
                            <br />
                            <?php if(StaticFunctions::detect_os($user_agent) == Constants::MAC_OS) { ?>
                            <span class="multi_select_inst">Use Command-key to select multiple items</span>
                            <?php } else { ?>
                            <span class="multi_select_inst">Use Ctrl-key to select multiple items</span>
                            <?php } ?>
                        </div>     
                    </td>
                    <td style="text-align: right; width: 7%;">Subsets:</td>
                    <td style="text-align: left; width: 26%;">
                        <div id="pa_subset">
                            <?php
                              echo $pa_subset_select->get_html(7);
                            ?>
                            <br />
                            <?php if(StaticFunctions::detect_os($user_agent) == Constants::MAC_OS) { ?>
                            <span class="multi_select_inst">Use Command-key to select multiple items</span>
                            <?php } else { ?>
                            <span class="multi_select_inst">Use Ctrl-key to select multiple items</span>
                            <?php } ?>             
                        </div>
                    
                    </td>
                    <td style="text-align: right; width: 7%;">Footnotes:</td>
                    <td style="text-align: left; width: 27%;">
                        <div id="pa_footnotes">
                            <?php
                              echo $pa_footnote_select->get_html(7);
                            ?>
                            <br />
                            <?php if(StaticFunctions::detect_os($user_agent) == Constants::MAC_OS) { ?>
                            <span class="multi_select_inst">Use Command-key to select multiple items</span>
                            <?php } else { ?>
                            <span class="multi_select_inst">Use Ctrl-key to select multiple items</span>
                            <?php } ?>             
                        </div>
                    </td>
                </tr>
                <!-- End Participating Agents -->   
                
                <!-- Begin Additional Search Parameters -->     
                <tr class="search_params_top">
                    <td style="text-align: center;" colspan="6">Additional Search Parameters</td>
                </tr>
                <tr class="search_params_bottom">
                    <td style="text-align: center;" colspan="6">
                        <table>
                        <tr>
                            <td style="text-align: right; width: 10%;">Emergencies:</td> 
                            <td style="text-align: left; width: 40%;"> 
                                <div id="emergencies">
                                    <?php
                                      echo $emergency_select->get_html(9);
                                    ?>
                                    <br />
                                    <?php if(StaticFunctions::detect_os($user_agent) == Constants::MAC_OS) { ?>
                                    <span class="multi_select_inst">Use Command-key to select multiple items</span>
                                    <?php } else { ?>
                                    <span class="multi_select_inst">Use Ctrl-key to select multiple items</span>
                                    <?php } ?>             
                                </div>
                            </td>
                            <td style="text-align: right; width: 10%;">Timeframes:</td> 
                            <td style="text-align: left; width: 40%;"> 
                                <div id="timeframes">
                                    <?php
                                      echo $timeframe_select->get_html(9);
                                    ?>
                                   <br />
                                   <?php if(StaticFunctions::detect_os($user_agent) == Constants::MAC_OS) { ?>
                                   <span class="multi_select_inst">Use Command-key to select multiple items</span>
                                   <?php } else { ?>
                                   <span class="multi_select_inst">Use Ctrl-key to select multiple items</span>
                                   <?php } ?>             
                                </div>
                            </td>                                                    
                        </tr>
                        <tr>
                            <td style="text-align: right; width: 10%;">Actions:</td> 
                            <td style="text-align: left; width: 40%;"> 
                                <div id="actions">
                                    <?php
                                      echo $action_select->get_html(9);
                                    ?>
                                   <br />
                                   <?php if(StaticFunctions::detect_os($user_agent) == Constants::MAC_OS) { ?>
                                   <span class="multi_select_inst">Use Command-key to select multiple items</span>
                                   <?php } else { ?>
                                   <span class="multi_select_inst">Use Ctrl-key to select multiple items</span>
                                   <?php } ?>             
                                </div>
                            </td>
                            <td style="text-align: right; width: 10%;">Goals:</td> 
                            <td style="text-align: left; width: 40%;"> 
                                <div id="goals">
                                    <?php
                                      echo $goal_select->get_html(9);
                                    ?>
                                   <br />
                                   <?php if(StaticFunctions::detect_os($user_agent) == Constants::MAC_OS) { ?>
                                   <span class="multi_select_inst">Use Command-key to select multiple items</span>
                                   <?php } else { ?>
                                   <span class="multi_select_inst">Use Ctrl-key to select multiple items</span>
                                   <?php } ?>             
                                </div>
                            </td>                            
                        </tr>
                        <tr>
                            <td style="text-align: right; width: 10%;">Prescriptions:</td> 
                            <td style="text-align: left; width: 40%;"> 
                                <div id="prescriptions">
                                    <?php
                                      echo $prescription_select->get_html(9);
                                    ?>
                                   <br />
                                   <?php if(StaticFunctions::detect_os($user_agent) == Constants::MAC_OS) { ?>
                                   <span class="multi_select_inst">Use Command-key to select multiple items</span>
                                   <?php } else { ?>
                                   <span class="multi_select_inst">Use Ctrl-key to select multiple items</span>
                                   <?php } ?>             
                                </div>
                            </td>
                            <td style="text-align: right; width: 10%;">Purposes:</td> 
                            <td style="text-align: left; width: 40%;"> 
                                <div id="purposes">
                                    <?php
                                      echo $purpose_select->get_html(9);
                                    ?>
                                   <br />
                                   <?php if(StaticFunctions::detect_os($user_agent) == Constants::MAC_OS) { ?>
                                   <span class="multi_select_inst">Use Command-key to select multiple items</span>
                                   <?php } else { ?>
                                   <span class="multi_select_inst">Use Ctrl-key to select multiple items</span>
                                   <?php } ?>             
                                </div>
                            </td>                            
                        </tr>     
                        <tr>
                            <td style="text-align: right; width: 10%;">Conditions:</td>
                            <td style="text-align: left; width: 90%;" colspan="3">
                                <div id="conditions">
                                    <?php
                                      echo $condition_select->get_html(9);
                                    ?>
                                    <br />
                                    <?php if(StaticFunctions::detect_os($user_agent) == Constants::MAC_OS) { ?>
                                    <span class="multi_select_inst">Use Command-key to select multiple items</span>
                                    <?php } else { ?>
                                    <span class="multi_select_inst">Use Ctrl-key to select multiple items</span>
                                    <?php } ?>
                                </div>
                            </td>                                                    
                        </tr>                                          
                        </table>
                    </td>
                </tr>     
                <!-- End Additional Search Parameters --> 
                
                
                
                <tr>
                    <td style="text-align: center; width: 100%;" colspan="6">
                        <label for="txt_num_rec">Number of records per screen:</label>
                        <input id="txt_num_rec" type="text" name="txt_num_rec"
                               data-dojo-type="dijit/form/NumberTextBox" required="true"
                               value="5" size="2" style="width: 3em;"
                               data-dojo-props="constraints: {min:1,max:20,places:0}, rangeMessage: 'Must be from 1 to 20', invalidMessage: 'Invalid number of records'" />
                        <span style="font-size: smaller;">(Integer from 1 to 20)</span>
                    </td>     
                </tr>
                <tr>
                    <td style="text-align: center; width: 100%;" colspan="6">
                        <button id="btn_search" data-dojo-id="btn_search" data-dojo-type="dijit/form/Button" 
                                data-dojo-props="iconClass: 'dijitIconSearch'" type="submit">
                            Search
                        </button>
                        &nbsp;
                        <button id="btn_reset" data-dojo-id="btn_reset" data-dojo-type="dijit/form/Button" 
                                data-dojo-props="iconClass: 'dijitIconClear'" type="reset">
                            Clear All Values
                        </button>
                    </td>                 
                </tr>
                </table>
                </form>
            </div>
            <!-- End Search Tab -->
            
            <!-- Begin Upload Tab -->
            <div id="tab_upload" data-dojo-type="dijit/layout/ContentPane" 
                 <?php if($is_admin == true) { ?>
                   data-dojo-props="disabled:false"  
                 <?php } else { ?>
                   data-dojo-props="disabled:true"
                 <?php } ?>
                 title="Upload">
                <h2 style="text-align: center;">Legal and Ethical Indicators of Adaptive Public Health System Response</h2>
                <br />
                <form id="frm_upload" name="frm_upload" action="search_results.php" data-dojo-type="dijit/form/Form" class="frm_table" enctype="multipart/form-data">            
                <table id="table_document_properties">
                    <tr>
                        <td style="text-align: right; width: 40%;"><label for="txt_doc_cit">Document Citation:</label></td>
                        <td style="text-align: left; width: 60%;">
                            <input id="txt_doc_cit" type="text" name="txt_doc_cit"
                                       data-dojo-type="dijit/form/ValidationTextBox" required="true"
                                       style="width: 20em;"
                                       data-dojo-props="missingMessage:'Document Citation is required'" />
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right; width: 40%;"><label for="doc_date">Document Date:</label></td>
                        <td style="text-align: left; width: 60%;">
                            <input type="text" name="doc_date" id="doc_date" 
                                   style="width: 20em;"
                                   data-dojo-type="dijit/form/DateTextBox"
                                   data-dojo-props="missingMessage: 'Document Date is required'" 
                                   required="true" />
                        </td>                    
                    </tr>

                    <tr>
                        <td style="text-align: right; width: 40%;"><label for="txt_doc_hdr">Document Header:</label></td>
                        <td style="text-align: left; width: 60%;">
                            <textarea id="txt_doc_hdr" name="txt_doc_hdr" data-dojo-type="dijit/form/SimpleTextarea" 
                                      rows="4" cols="50" style="width: auto;">
                            </textarea>
                        </td>                    
                    </tr>  
                    <tr>
                        <td style="text-align: right; width: 40%;"><label for="txt_doc_body">Document Body:</label></td>
                        <td style="text-align: left; width: 60%;">
                            <textarea id="txt_doc_body" name="txt_doc_body" data-dojo-type="dijit/form/SimpleTextarea" 
                                      rows="6" cols="50" style="width: auto;">
                            </textarea>
                        </td>                    
                    </tr>
                    <tr>
                        <td style="text-align: right; width: 40%;"><label for="slct_jurisdiction_upload">Jurisdictions:</label></td>
                        <td style="text-align: left; width: 60%;">
                            <div id="jurisdictions_upload">
                                <?php
                                  echo $jurisdiction_select_upload->get_html(8);
                                ?>
                                <br />
                                <?php if(StaticFunctions::detect_os($user_agent) == Constants::MAC_OS) { ?>
                                <span class="multi_select_inst">Use Command-key to select multiple items</span>
                                <?php } else { ?>
                                <span class="multi_select_inst">Use Ctrl-key to select multiple items</span>
                                <?php } ?>             
                            </div>
                            <br />
                        </td>
                    </tr>                       
                    <tr>
                        <td style="text-align: right; width: 40%;">
                            <label for="slct_nodes_upload">Nodes:</label>
                            <br />
                            <a href="http://www.phasys.pitt.edu/pdf/Node_Definitions.pdf" id="node_def_link" target="_blank">Node Definitions</a>
                        </td>
                        <td style="text-align: left; width: 60%;">
                            <div id="nodes_upload">
                                <?php
                                  echo $node_select_upload->get_html(8);
                                ?>
                                <br />
                                <?php if(StaticFunctions::detect_os($user_agent) == Constants::MAC_OS) { ?>
                                <span class="multi_select_inst">Use Command-key to select multiple items</span>
                                <?php } else { ?>
                                <span class="multi_select_inst">Use Ctrl-key to select multiple items</span>
                                <?php } ?>
                            </div>
                            <br />
                        </td>
                    </tr>                    
                    <tr>
                        <td style="text-align: right; width: 40%;"><label for="slct_doc_frmt">Document Format:</label></td>
                        <td style="text-align: left; width: 60%;">
                            <div id="doc_frmt_upload">
                                <?php
                                  echo $doc_frmt_select_upload->get_html(8);
                                ?>
                            </div>
                        </td>
                    </tr>                                       
                    <tr>
                        <td style="text-align: center; width: 100%;" colspan="6">
                            <button id="btn_save" data-dojo-id="btn_save" data-dojo-type="dijit/form/Button" 
                                    data-dojo-props="iconClass:'dijitIconSave'" type="submit">
                                Save
                            </button>
                            &nbsp;
                            <button id="btn_reset_upload" data-dojo-id="btn_reset_upload" data-dojo-type="dijit/form/Button" 
                                    data-dojo-props="iconClass:'dijitIconClear'" type="reset">
                                Clear All Values
                            </button>
                        </td>
                    </tr>    
                    <tr>
                    	<td id="colImages">
			            </td>
                    </tr>                
                </table>
                </form>
                <h2>A basic grid with editors</h2>
		        (This test requires dijit to be installed)	
		        <div id="grid"></div>
		        <button type="button" id="save" onclick="grid.save()">Save</button>
            </div>
            <!-- End Upload Tab -->

        </div>
        <div class="edge_panel" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'top'">
            <div id="banner"><a href="http://www.pitt.edu" id="pittLogo">University of Pittsburgh</a>
                <ul>
                    <li><a href="http://www.pitt.edu" id="pitt-home">Pitt Home</a></li>	  
	                <li><a href="http://www.publichealth.pitt.edu/" id="gsph">GSPH Home</a></li>
                </ul>
            </div>
            <div id="phasys_header">
       	        <h1 style="margin: 0px;"><a href="http://www.phasys.pitt.edu">Public Health Adaptive Systems Studies&nbsp;&nbsp;</a>&nbsp;</h1>
		    </div> 
        </div>
        <div id="left_column" class="edgePanel" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'left', splitter: true">
            <div id="div_search_results">Your results will appear here.</div>
            <div id="div_search_results_nav"></div>
        </div>
    </div>
    <!-- configure Dojo -->
    <script>
      // Instead of using data-dojo-config, we're creating a dojoConfig
      // object *before* we load dojo.js; they're functionally identical,
      // it's just easier to read this approach with a larger configuration.
      var dojoConfig = {
        async: true,
        parseOnLoad: false,
        // This code registers the correct location of the "custom"
        // package
        packages: [ 
          {
            name: 'custom',
            location: location.pathname.replace(/\/[^/]+$/, '') + '/js/custom/'
          } 
        ]
      };
    </script>
    <!-- load dojo -->
    <script src="<?php echo Constants::WHERE_IS_DOJO . 'dojo/dojo.js'; ?>"></script>
    
    <script>
      require(
        [
          "dojo/parser", 
          "dijit/form/Button",
          "dijit/form/DateTextBox",
          "dijit/form/Form",
          "dijit/form/MultiSelect",
          "dijit/form/NumberTextBox",
          "dijit/form/RadioButton",
          "dijit/form/Select",
          "dijit/form/SimpleTextarea",
          "dijit/form/TextBox",
          "dijit/form/ValidationTextBox",
          "dijit/layout/BorderContainer", 
          "dijit/layout/ContentPane", 
          "dijit/layout/TabContainer",
          "custom/IndexModule",
          "dojo/domReady!"
        ],
        function(parser, btn, dateTxtBx, frm, mltSlct,
                 nmbrTxtBx, radBtn, slct, smplTxtarea,
                 txtBx, vldtnTxtBx, brdrCntnr, cntntPane,
                 tabCntnr, IndexModule) {
          parser.parse();
        }            
      );      
    </script>
    <!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
    <script>
      (function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
         function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
           e=o.createElement(i);r=o.getElementsByTagName(i)[0];
           e.src='//www.google-analytics.com/analytics.js';
           r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
      ga('create','UA-XXXXX-X');ga('send','pageview');
    </script>
</body>


</html>
